package com.yy.controller;

import com.yy.domain.SysRole;
import com.yy.model.Result;
import com.yy.service.SysRoleService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 描述 角色管理相关API
 * 作者 yy
 */
@RestController
@Api(tags = "角色管理相关API")
@RequestMapping("sys/role")
public class SysRoleController {

    @Autowired
    private SysRoleService sysRoleService;

    /**
     * 加载所有角色不分页
     * @return
     */
    @GetMapping("list")
    public Result<List<SysRole>> list(){
        List<SysRole> sysRoles= this.sysRoleService.loadSysRoleList();
        return Result.success(sysRoles);
    }
}
